
import { lazy } from 'react'
import Error from '../pages/404/index'
import { createBrowserRouter } from 'react-router-dom'  
// const Home = lazy(() => import('../pages/Home/index'))
// const My = lazy(() => import('../pages/My/index'))
// const Layout = lazy(() => import('../pages/Layout/index'))
// const Msg = lazy(() => import('../pages/Msg/index'))
const Login = lazy(() => import('../pages/Login/index'))
// const List = lazy(() => import('../pages/List/index'))
const Detail = lazy(() => import('../pages/Detail/index'))
const Reg = lazy(() => import('../pages/Reg/index'))
// const City = lazy(() => import('../pages/City/index'))

import Home from '../pages/Home/index' 
import My from '../pages/My/index' 
import Msg from '../pages/Msg/index' 
import Layout from '../pages/Layout/index'
import City from '../pages/City/index'
import Jqsy from '../pages/Jqsy/index'
import List from '../pages/List/index'
// import Detail from '../pages/Detail/index'
// import Reg from '../pages/Reg/index'
const router=[{
            path:'/',
            element:<Layout/>,
            children:[
                {
                    index:true,
                    element:<Home/>
                },
                {
                    path:'/',
                    element:<Home/>
                },
                {
                    path:'/my',
                    element:<My/>
                },
                {
                    path:'/msg',
                    element:<Msg/>
                }
            ]
        },
        {
            path:'/login',
            element:<Login/>
        },
        
        {
            path:'/jqsy',
            element:<Jqsy/>
        },
         {
            path:'/reg',
            element:<Reg/>
        },
        {
            path:'/list',
            element:<List/>
        },
          {
            path:'/city',
            element:<City/>
        },
        {
            path:'/detail',
            element:<Detail/>
        },
        {
            path:'*',
            element:<Error/>
        }]   
export default createBrowserRouter(router)